<extend name="Public/base"/>

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$title}</h2>
    </div>
    <p class="check-tips" style="color: red">注：编辑完善产品展示名称和产品展示图后，且状态为有效，才可在产品类别模块中添加该产品。</p>
    <!-- 按钮工具栏 -->
    <!--<div class="cf">-->
        <!--<a class="btn fr fh_dis" href="{:U('product_add')}" style="margin: 0px">新增</a>-->
    <!--</div>-->
    <!-- 数据列表 -->
    <div class="data">
        <table class="">
            <thead>
            <tr>
                <th class="public_tanle_qianmian">产品编码</th>
                <th class="public_tanle_qianmian">产品系统名称</th>
                <th class="public_tanle_qianmian">状态</th>
                <th class="public_tanle_qianmian">产品展示名称</th>
                <th class="public_tanle_qianmian">产品展示图</th>
                <th class="public_content_lost1">操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="list">
                <volist name="list" id="vo">
                    <tr>
                        <td class="public_content_qianmian">{$vo.p_id|default='--'}</td>
                        <td class="public_content_qianmian">{$vo.p_name|default='--'}</td>
                        <td class="public_content_qianmian">
                            <if condition="$vo.status == 1"><span style="color: #00cc00">有效</span>
                            <elseif condition="$vo.status == 0" /><span style="color: red">无效</span>
                            <elseif condition="$vo.status == 2" /><span style="color: orange">挂起</span>
                            <else />未知
                            </if>
                        </td>
                        <td class="public_content_qianmian">{$vo.name|default='--'}</td>
                        <if condition="$vo.img_url eq ''">
                            <td class="public_content_qianmian" width="120px">--</td>
                        <else />
                            <td class="public_content_qianmian" width="120px"><img src="{$vo.img_url}" style="height: auto;" /></td>
                        </if>
                        <td class="public_content_lost1 public_content_jl" style="text-align:center;width: 60px;">
                            <!--<p><a href="{:U('product_detail?id='.$vo['id'])}" class="reward_pass">详情</a></p>-->
                            <p><a href="{:U('product_edit?id='.$vo['id'])}" class="reward_pass">编辑</a></p>
                            <!--<p><a href="{:U('product_del?id='.$vo['id'])}" class="del">删除</a></p>-->
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="100" class="text-center"> 暂时没有内容 </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <!-- 分页 -->
    <div class="page">
        {$page}
    </div>
</block>

<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <!-- 引入CSS、JS开始 -->
    <link href="__CSS__/wash_helper/gm_table_public.css" rel="stylesheet" type="text/css">
    <!-- 引入CSS、JS结束 -->
    <script type="text/javascript">
        $(function () {
            /* 无刷新禁用 */
            $('.del').click(function(){
                var target;
                var that = this;

                if(!confirm('删除将不可恢复，确认删除吗？')){
                    return false;
                }

                target = $(this).attr('href');
                $.get(target).success(function(data){
                    if (data.status==1) {
                        if (data.url) {
                            updateAlert(data.info + ' 页面即将自动跳转~','alert-success');
                        }else{
                            updateAlert(data.info,'alert-success');
                        }
                        setTimeout(function(){
                            if (data.url) {
                                location.href=data.url;
                            }else if( $(that).hasClass('no-refresh')){
                                $('#top-alert').find('button').click();
                            }else{
                                location.reload();
                            }
                        },1500);
                    }else{
                        updateAlert(data.info);
                        setTimeout(function(){
                            if (data.url) {
                                location.href=data.url;
                            }else{
                                $('#top-alert').find('button').click();
                            }
                        },1500);
                    }
                });
                return false;
            });
        })
    </script>
</block>